home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / v10n18.arc / LN1018.ARC / FILOPEN next >
Text File  |  1991-10-30  |  586b  |  16 lines

  1. Sub MAIN
  2.     On Error Goto done          ' in case user clicks Cancel
  3.     Dim dlg As FileOpen         ' create a FileOpen dialog 
  4.     Dialog dlg                  ' show the dialog box
  5.     ' We get back here when the user clicks Ok
  6.     Print dlg.Name              ' .Name is the field we want
  7.     ' for some reason, we forbid the user to open files whose
  8.     ' name contains the string "phoo"
  9.     If InStr(LCase$(dlg.Name), "phoo") = 0 Then
  10.         FileOpen dlg.Name       ' run the FileOpen macro
  11.     Else
  12.         MsgBox "Authorization failure"
  13.     End If
  14. done:
  15. End Sub
  16.